package com.aloda.ojcommon.exception;

import com.aloda.ojcommon.constant.ErrorCode;
import lombok.Data;

/**
 * @Author aloda
 * @Date 2025/4/20 14:56
 */
@Data
public class ParamsException extends RuntimeException{

    private Integer errorCode;

    public ParamsException() {
    }

    public ParamsException(String message){
        super(message);
        this.errorCode = 0;
    }

    public ParamsException(Integer errorCode, String message){
        super(message);
        this.errorCode = errorCode;
    }

    public ParamsException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode.getCode();
    }
}
